{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "字典的创建方式\n",
    "\n",
    "1.1 直接创建，按照字典的结构：{key1:value1,key2:value2}\n",
    " 1.2 dict() 创建字典，dict(key1:value1,key2:value2)\n",
    " 2.字典的性质\n",
    "\n",
    "# 方法一\n",
    "stu_info = {\n",
    "    'stu01':'hy',\n",
    "    'stu02':'ss',\n",
    "    'stu03':'yue'\n",
    "}\n",
    "\n",
    "stu_01 = {\n",
    "    'name':'hy',\n",
    "    'age':'20',\n",
    "    'job':'student'\n",
    "}\n",
    "stu_info\n",
    "{'stu01': 'hy', 'stu02': 'yue', 'stu03': 'ji'}\n",
    "\n",
    "# 方法二，新建空字典，然后增加值的方式创建字典\n",
    "\n",
    "stu_info_03 = {}\n",
    "\n",
    "stu_info_03['stu1001'] = 'alo',# 字典的增加\n",
    "stu_info_03['stu1002'] = 'kol',\n",
    "stu_info_03['stu1003'] = 'ppd'\n",
    "stu_info_03\n",
    "{'stu1001': ('alo',), 'stu1002': ('kol',), 'stu1003': 'ppd'}\n",
    "\n",
    "\n",
    "\n",
    "get 查询，item检查内容，clear清除，update更新所有的值\n",
    "用表格使用和学习字典方法\n",
    "\n",
    "stu_01  = {\n",
    "    'hy':20,\n",
    "    'ss':21,\n",
    "    'yue':22,\n",
    "}\n",
    "stu_01\n",
    "{'hy': 20, 'ss': 21, 'yue': 22}\n",
    "stu_01 = dict(\n",
    "    stu01 = 'hy',\n",
    "    stu02 = 'ss',\n",
    "    stu03 = 'yue'\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}